﻿using FaissOperation.FaissIndex.Native;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FaissOperation.FaissIndex.Index
{
    public static class FaissIndexFactory
    {
        public static IFaissIndex CreateFlat(int dimension, FaissMetricType metricType = FaissMetricType.METRIC_L2)
        {
            return new FlatIndex(dimension, metricType);
        }

        public static IFaissIndex CreateIVF(int dimension, int nlist, FaissMetricType metricType = FaissMetricType.METRIC_L2)
        {
            using var quantizer = new FlatIndex(dimension, metricType);
            return new IVFIndex(quantizer, dimension, nlist, metricType);
        }
    }
}
